package com.example.film.service;

import com.example.film.entity.Top250Film;
import com.example.film.mapper.Top250FilmMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Top250FilmServiceImpl implements Top250FilmService{
    @Autowired
    private Top250FilmMapper top250FilmMapper;

    @Override
    public List<Top250Film> findTop250Film() {
        return top250FilmMapper.findTop250Film();
    }

    @Override
    public List<Top250Film> findTop250FilmInfo(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return top250FilmMapper.findTop250FilmInfo(startIndex, pageSize);
    }
}
